<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./template/user.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">

    <ui:define name="header">
    </ui:define>

    <ui:define name="context">
        #{a_maritalManagedBean.set_list()}
        #{a_countryManagedBean.set_list()}  
        #{a_languageManagedBean.set_list()}
        #{a_religionManagedBean.set_list()}
        #{a_casteManagedBean.set_list()}
        #{a_roleManagedBean.set_list()}
        #{a_likingsManagedBean.set_list()}       
        #{u_editProfileManagedBean.init_dialog()}
        <div class="feat_prod_box">
            <div class="prod_img">
                <p:graphicImage library="user/images/avatar" name="#{u_memberManagedBean.Get_User_Avatar()}" width="88" 
                                height="96"/>
            </div>
            <div class="prod_det_box">
                <p:panelGrid columns="2" style="border-style: hidden !important;">
                    <h:outputText value="Username" />  
                    <h:inputText value="#{u_memberManagedBean.member.username}"/>
                    <h:outputText value="Full Name" />  
                    <h:inputText value="#{u_memberManagedBean.member.fullName}"/>
                    <h:outputText value="Nick Name" />  
                    <h:inputText value="#{u_memberManagedBean.member.nickName}"/>
                    <h:outputText value="Email" />  
                    <h:inputText value="#{u_memberManagedBean.member.email}"/>
                    <h:outputText value="Height"/>  
                    <h:inputText value="#{u_memberManagedBean.member.height}"/>
                    <h:outputText value="Contact Number" />  
                    <h:inputText value="#{u_memberManagedBean.member.contactNumber}"/>
                    <h:outputText value="Working At" />  
                    <h:inputText value="#{u_memberManagedBean.member.workingAt}"/>
                    <h:outputText value="Family" />  
                    <h:inputText value="#{u_memberManagedBean.member.family}"/>
                    <h:outputText value="Address" />  
                    <h:inputText value="#{u_memberManagedBean.member.address}"/>
                    <h:outputText value="Hobbies" />  
                    <h:inputText value="#{u_memberManagedBean.member.hobbies}"/>
                    <h:outputLabel value="Birthday"/>
                    <p:calendar effect="explode" value="#{u_memberManagedBean.member.birthday}"
                                pattern="dd/MM/yyyy">
                    </p:calendar>
                    <h:outputText value="Martial Status"/>                      
                    <h:selectOneMenu value="#{u_memberManagedBean.member.IDMarital.id}" required="true">    
                        <f:selectItems var="martial" value="#{a_maritalManagedBean.list}" itemLabel="${martial.maritalStatus}" itemValue="${martial.id}"/>  
                    </h:selectOneMenu>
                    <h:outputText value="Country"/>                      
                    <h:selectOneMenu id="MenuCountry" value="#{u_editProfileManagedBean.editedCountry.id}" required="true">    
                        <f:selectItems var="country" value="#{a_countryManagedBean.list}" itemLabel="${country.country}" itemValue="${country.id}"/>  
                        <p:ajax update="MenuState" listener="#{u_editProfileManagedBean.handleStateChange()}"/>
                    </h:selectOneMenu>
                    <h:outputText value="State"/>                      
                    <h:selectOneMenu id="MenuState" value="#{u_memberManagedBean.member.IDState.id}">
                        <f:selectItems var="state" value="#{u_editProfileManagedBean.selectStateList}" itemLabel="${state.state}" itemValue="${state.id}"/>  
                    </h:selectOneMenu>
                    <h:outputText value="Language"/>                      
                    <h:selectOneMenu value="#{u_memberManagedBean.member.IDLanguage.id}">
                        <f:selectItems var="language" value="#{a_languageManagedBean.list}" itemLabel="${language.language}" itemValue="${language.id}"/>  
                    </h:selectOneMenu>
                    <h:outputText value="Religion"/>                      
                    <h:selectOneMenu value="#{u_memberManagedBean.member.IDReligion.id}">
                        <f:selectItems var="religion" value="#{a_religionManagedBean.list}" itemLabel="${religion.religion}" itemValue="${religion.id}"/>  
                    </h:selectOneMenu>
                    <h:outputText value="Catse"/>                      
                    <h:selectOneMenu value="#{u_memberManagedBean.member.IDCasle.id}">
                        <f:selectItems var="caste" value="#{a_casteManagedBean.list}" itemLabel="${caste.caste}" itemValue="${caste.id}"/>  
                    </h:selectOneMenu>
                    
                    <h:outputText value="Liking"/>
                    <p:selectCheckboxMenu id="MenuLiking" value="#{u_editProfileManagedBean.editedLikings}" label="Likings" 
                                          filter="true" filterMatchMode="startsWith" 
                                          panelStyle="width:220px">  
                        <f:selectItems var="liking" value="#{a_likingsManagedBean.list}" itemLabel="${liking.likings}" itemValue="${liking.id}"/>  
                    </p:selectCheckboxMenu>

                    <f:facet name="footer">
                        <p:commandButton id="btnEdit" value="Edit" 
                                         actionListener="#{u_editProfileManagedBean.edit()}"
                                         update="form"/>
                    </f:facet>
                </p:panelGrid>
            </div>
        </div>
    </ui:define>

</ui:composition>
